home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / asmutil / coreaids.zip / SRCH_VOL.ASM < prev    next >
Assembly Source File  |  1987-06-25  |  1KB  |  73 lines

  1. ;    DESC:    Search for a volume name                             V1.00
  2. ;    IN:    *{DRIVE} drive number (0:default,1:A,2:B,etc...)
  3. ;    OUT:    *{SEG_VAL} segment and
  4. ;        *{OFFSET} offset of volume name
  5. ;        *{FLAG} has a value of 0 if a volume label is found
  6. ;    SAMPLE:    Callm,<DRIVE>,<SEG_VAL,OFFSET,FLAG>
  7. ;    ################################################################
  8.  
  9. SRCH_VOD Segment Para Public 'DATA'
  10. TRANSFER    DB    80H DUP(0)
  11. SEGER        DW    0
  12. OFFER        DW    0
  13. FCBSRCH        DB    0FFH,5 DUP(0),8
  14. DRIVE        DB    0
  15.         DB    '???????????'
  16. SRCH_VOD Ends
  17.  
  18.  
  19.     Extrn    PUSHALL:Near
  20.     Extrn    POPALL:Near
  21.     Extrn    GET_DSK:Near
  22.     Extrn    SET_DSK:Near
  23.  
  24. SRCH_VOC    Segment
  25.     Assume    CS:SRCH_VOC,DS:SRCH_VOD
  26.     Public    SRCH_VOL
  27.  
  28.                         ;notice.
  29.     DB    'SRCH_VOL - V1.00, Copyright 1987, CoreTechs   ',0DH,0AH
  30.  
  31. SRCH_VOL    Proc    Near
  32.     Call    PUSHALL                ;save registers.
  33.  
  34.     Mov    AX,SRCH_VOD            ;setup workarea.
  35.     Mov    DS,AX
  36.  
  37.     Call    GET_DSK                ;get DTA.
  38.     Pop    SEGER                ;and save address.
  39.     Pop    OFFER
  40.  
  41.     Pop    AX                ;recover drive number.
  42.  
  43.     Mov    DRIVE,AL            ;save drive number.
  44.  
  45.     Push    DS                ;setup DTA.
  46.     Mov    AX,OFFSET TRANSFER
  47.     Push    AX
  48.     Call    SET_DSK
  49.  
  50.     Mov    AX,1100H            ;search for volume name.
  51.     Mov    DX,OFFSET FCBSRCH
  52.     Int    21H
  53.  
  54.     Mov    AH,0                ;return search flag.
  55.     Push    AX
  56.  
  57.     Mov    AX,OFFSET TRANSFER
  58.     Add    AX,8
  59.  
  60.     Push    AX                ;return offset and
  61.     Push    DS                ;segment of volume name.
  62.  
  63.     Push    SEGER                ;restore DTA.
  64.     Push    OFFER
  65.     Call    SET_DSK
  66.  
  67.     Call    POPALL                ;restore registers.
  68.     Ret
  69. SRCH_VOL    Endp
  70.  
  71. SRCH_VOC    Ends
  72.     End
  73.